<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title>無心道-登录</title>
    <link rel="stylesheet" type="text/css" href="style/public.css"/>

    <script charset="utf-8" type="text/javascript" src="/js/base64.js"></script>
    <script charset="utf-8" type="text/javascript" src="/js/query-map.js"></script>
    <script charset="utf-8" type="text/javascript" src="/js/ajax-1.1.js"></script>

    <script type="text/javascript">
        function login() {
            var pwd = $("txt_user_pwd").value;
            pwd = Base64.encode(pwd); // 编码
            pwd = encodeURIComponent(pwd);
            var map = "userName=" + $("txt_user_name").value + "&userPwd=" + pwd;
            Ajax.post("/sign", map,
                function (ajaxObj) {
                    // 数据是保存在 异步对象的 属性中
                    if (ajaxObj.responseText.toString().indexOf("ok") >= 0) {
                        top.location.href = "index.html";
                        return;
                    }
                    alert("用户名 或者 密码错误");
                }
            );
        }
    </script>
</head>

<body>
<div style="display:block; background-color: rgba(31, 117, 235, 0.8); width:100%; height:100%;">
    <div style="width: 280px; height: 200px; position: absolute; text-align: center; top: 45%; left: 50%; background-color: white; transform: translate(-50%,-50%); z-index: 9999;">
        <table>
            <tr>
                <td></td>
                <td style="text-align: center;">
                    <h3>無心道--登录&nbsp;&nbsp;&nbsp;&nbsp;</h3>
                </td>
            </tr>
            <tr>
                <td>账号：</td>
                <td style="text-align: left;">
                    <input id="txt_user_name" name="txt_user_name" type="text" style="width: 200px;"/>
                </td>
            </tr>
            <tr>
                <td>密码：</td>
                <td style="text-align: left;">
                    <input id="txt_user_pwd" name="txt_user_pwd" type="password" style="width: 200px;"/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td style="text-align: center;">
                    <input type="button" onclick="javascript: login();" value="登录"/>&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
        </table>
    </div>
</div>
</body>
</html>
